<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://unpkg.com/vue@next"></script>
</head>
<body>
  <div id="app">
    <div>父组件: {{ opt }}</div>
    <my-component v-model:foo="opt" />
  </div>

  <script>
    const app = Vue.createApp({
      setup() {
        const opt = Vue.ref('选项2')
        return {
          opt
        }
      }
    })

    app.component('my-component', {
      props: {
        foo: String
      },
      template: `
      <div>
        子组件：{{ foo }} <br/>
        <select :value="foo" @input="$emit('update:foo', $event.target.value)">
          <option value="选项1">选项1</option>
          <option value="选项2">选项2</option>
          <option value="选项3">选项3</option>
        </select>
      </div>
      `
    })

    app.mount('#app')
  </script>
</body>
</html>